import {defineStore} from 'pinia'

export const useCounterStore = defineStore('counter', {
  state: () => {
    return {
      dialogVisible: false,
      message: '', // 添加message状态
      websocket: null, // 添加websocket状态
      skipData: {
        id: "",
        passengerId: "",
        max_seat_capacity: "",
        num_passengers: "",
        price: "",
        route: "",
        start_date: "",
        start_time: "",
        status: ""
      }
    }
  },
  actions: {
    isDialogTrue() {
      this.dialogVisible = true
    },
    isDialogFalse() {
      this.dialogVisible = false
    },
    setMessage(payload) {
      this.message = payload;
    },
    // 添加setWebsocket方法
    setWebsocket(ws) {
      this.websocket = ws;
    }
  }
})
